﻿
namespace Halk.Config
{
    /// <summary>
    /// 规则实体类
    /// </summary>
    public class RuleEntity
    {
        #region 变量定义
        ///<summary>
        ///规则编号
        ///</summary>
        private RulePara _ruleID = new RulePara();
        ///<summary>
        ///规则版本
        ///</summary>
        private RulePara _ruleVersion = new RulePara();
        ///<summary>
        ///站点名称
        ///</summary>
        private RulePara _getSiteName = new RulePara();
        ///<summary>
        ///站点编码
        ///</summary>
        private RulePara _getSiteCharset = new RulePara();
        ///<summary>
        ///站点地址
        ///</summary>
        private RulePara _getSiteUrl = new RulePara();
        ///<summary>
        ///站点搜索地址
        ///</summary>
        private RulePara _novelSearchUrl = new RulePara();
        ///<summary>
        ///搜索提交内容
        ///{SearchKey} 表示搜索提交的内容
        ///</summary>
        private RulePara _novelSearchData = new RulePara();
        ///<summary>
        ///从搜索结果中获得小说编号
        ///{SearchKey} 表示搜索提交的内容
        ///此获得结果存入{NovelKey}变量
        ///</summary>
        private RulePara _novelSearch_GetNovelKey = new RulePara();
        ///<summary>
        ///站点最新列表地址
        ///</summary>
        private RulePara _novelListUrl = new RulePara();
        ///<summary>
        ///从最新列表中获得小说编号
        ///此规则中可以同时获得书名以方便手动时查看
        ///此获得结果存入{NovelKey}变量
        ///</summary>
        private RulePara _novelList_GetNovelKey = new RulePara();
        ///<summary>
        ///小说信息页地址 可调用{NovelKey}变量
        ///{NovelKey}一般情况表示小说编号
        ///</summary>
        private RulePara _novelUrl = new RulePara();
        ///<summary>
        ///小说信息页错误识别标记
        ///</summary>
        private RulePara _novelErr = new RulePara();
        ///<summary>
        ///获得小说名称正则
        ///支持多模板
        ///</summary>
        private RulePara _novelName = new RulePara();
        ///<summary>
        ///获得小说大类正则
        ///支持多模板
        ///</summary>
        private RulePara _lagerSort = new RulePara();
        ///<summary>
        ///获得小说小类正则
        ///支持多模板
        ///如果目标站点没有小类，这里就重复输入一次大类规则
        ///</summary>
        private RulePara _smallSort = new RulePara();
        ///<summary>
        ///获得小说简介正则
        ///支持多模板
        ///</summary>
        private RulePara _novelIntro = new RulePara();
        ///<summary>
        ///获得小说主角(关键字)正则
        ///支持多模板
        ///</summary>
        private RulePara _novelKeyword = new RulePara();
        ///<summary>
        ///获得写作进程正则
        ///支持多模板
        ///</summary>
        private RulePara _novelDegree = new RulePara();
        ///<summary>
        ///获得小说封面正则
        ///支持多模板
        ///</summary>
        private RulePara _novelCover = new RulePara();
        ///<summary>
        ///目标站默认封面地址
        ///遇到这个地址就不采集它的封面
        ///</summary>
        private RulePara _novelDefaultCoverUrl = new RulePara();
        ///<summary>
        ///获得小说公众目录页地址正则
        ///支持多模板
        ///</summary>
        private RulePara _novelInfo_GetNovelPubKey = new RulePara();
        ///<summary>
        ///访问公众版需要登陆的Cookies
        ///一般无关，小说阅读网需要这个
        ///</summary>
        private RulePara _pubCookies = new RulePara();
        ///<summary>
        ///公众目录页地址 可调用{NovelPubKey} {NovelKey}变量
        ///</summary>
        private RulePara _pubIndexUrl = new RulePara();
        ///<summary>
        ///公众目录页错误识别标记
        ///</summary>
        private RulePara _pubIndexErr = new RulePara();
        ///<summary>
        ///获得目录部分关键HTML，一般可留空
        ///</summary>
        private RulePara _pubVolumeContent = new RulePara();
        ///<summary>
        ///分割分卷
        ///</summary>
        private RulePara _pubVolumeSplit = new RulePara();
        ///<summary>
        ///获得分卷名
        ///支持多模板
        ///</summary>
        private RulePara _pubVolumeName = new RulePara();
        ///<summary>
        ///获得章节名
        ///</summary>
        private RulePara _pubChapterName = new RulePara();
        ///<summary>
        ///
        ///</summary>
        private RulePara _novelAuthor = new RulePara();
        ///<summary>
        ///获得章节地址(章节编号)，所获得的数量必须和章节名相同。记录变量{ChapterKey}
        ///</summary>
        private RulePara _pubChapter_GetChapterKey = new RulePara();
        ///<summary>
        ///章节内容页地址 可调用{ChapterKey} {NovelKey}变量
        ///</summary>
        private RulePara _pubContentUrl = new RulePara();
        ///<summary>
        ///章节内容页错误识别标记
        ///</summary>
        private RulePara _pubContentErr = new RulePara();
        ///<summary>
        ///内容页中真实内容有JS调用的，获得JS地址 记录变量{TextKey}
        ///</summary>
        private RulePara _pubContent_GetTextKey = new RulePara();
        ///<summary>
        ///组合真实内容地址
        ///</summary>
        private RulePara _pubTextUrl = new RulePara();
        ///<summary>
        ///获得章节内容的正则
        ///支持多模板
        ///(替换在获取图片前)
        ///</summary>
        private RulePara _pubContentText = new RulePara();
        ///<summary>
        ///每行一个替换，格式如下
        ///需要替换的内容♂替换结果
        ///<div.+?>  这个表示过滤
        ///<div.+?>♂<br>  这个表
        ///</summary>
        private RulePara _pubContentReplace = new RulePara();
        ///<summary>
        ///章节内容中提取图片正则
        ///</summary>
        private RulePara _pubContentImages = new RulePara();
        /// <summary>
        /// 小说全本标记
        /// </summary>
        private RulePara _novelFullText = new RulePara();
        #endregion

        #region 构造函数

        public RuleEntity()
        { }

        ///<summary>
        ///
        ///</summary>
        public RuleEntity
        (
             RulePara ruleID,
             RulePara ruleVersion,
             RulePara getSiteName,
             RulePara getSiteCharset,
             RulePara getSiteUrl,
             RulePara novelSearchUrl,
             RulePara novelSearchData,
             RulePara novelSearch_GetNovelKey,
             RulePara novelListUrl,
             RulePara novelList_GetNovelKey,
             RulePara novelUrl,
             RulePara novelErr,
             RulePara novelName,
             RulePara lagerSort,
             RulePara smallSort,
             RulePara novelIntro,
             RulePara novelKeyword,
             RulePara novelDegree,
             RulePara novelCover,
             RulePara novelDefaultCoverUrl,
             RulePara novelInfo_GetNovelPubKey,
             RulePara pubCookies,
             RulePara pubIndexUrl,
             RulePara pubIndexErr,
             RulePara pubVolumeContent,
             RulePara pubVolumeSplit,
             RulePara pubVolumeName,
             RulePara pubChapterName,
             RulePara novelAuthor,
             RulePara pubChapter_GetChapterKey,
             RulePara pubContentUrl,
             RulePara pubContentErr,
             RulePara pubContent_GetTextKey,
             RulePara pubTextUrl,
             RulePara pubContentText,
             RulePara pubContentReplace,
             RulePara pubContentImages,
            RulePara novelFullText
        )
        {
            _ruleID = ruleID;
            _ruleVersion = ruleVersion;
            _getSiteName = getSiteName;
            _getSiteCharset = getSiteCharset;
            _getSiteUrl = getSiteUrl;
            _novelSearchUrl = novelSearchUrl;
            _novelSearchData = novelSearchData;
            _novelSearch_GetNovelKey = novelSearch_GetNovelKey;
            _novelListUrl = novelListUrl;
            _novelList_GetNovelKey = novelList_GetNovelKey;
            _novelUrl = novelUrl;
            _novelErr = novelErr;
            _novelName = novelName;
            _lagerSort = lagerSort;
            _smallSort = smallSort;
            _novelIntro = novelIntro;
            _novelKeyword = novelKeyword;
            _novelDegree = novelDegree;
            _novelCover = novelCover;
            _novelDefaultCoverUrl = novelDefaultCoverUrl;
            _novelInfo_GetNovelPubKey = novelInfo_GetNovelPubKey;
            _pubCookies = pubCookies;
            _pubIndexUrl = pubIndexUrl;
            _pubIndexErr = pubIndexErr;
            _pubVolumeContent = pubVolumeContent;
            _pubVolumeSplit = pubVolumeSplit;
            _pubVolumeName = pubVolumeName;
            _pubChapterName = pubChapterName;
            _novelAuthor = novelAuthor;
            _pubChapter_GetChapterKey = pubChapter_GetChapterKey;
            _pubContentUrl = pubContentUrl;
            _pubContentErr = pubContentErr;
            _pubContent_GetTextKey = pubContent_GetTextKey;
            _pubTextUrl = pubTextUrl;
            _pubContentText = pubContentText;
            _pubContentReplace = pubContentReplace;
            _pubContentImages = pubContentImages;
            _novelFullText = novelFullText;

        }
        #endregion

        #region 公共属性

        ///<summary>
        ///规则编号
        ///</summary>
        public RulePara RuleID
        {
            get { return _ruleID; }
            set { _ruleID = value; }
        }

        ///<summary>
        ///规则版本
        ///</summary>
        public RulePara RuleVersion
        {
            get { return _ruleVersion; }
            set { _ruleVersion = value; }
        }

        ///<summary>
        ///站点名称
        ///</summary>
        public RulePara GetSiteName
        {
            get { return _getSiteName; }
            set { _getSiteName = value; }
        }

        ///<summary>
        ///站点编码
        ///</summary>
        public RulePara GetSiteCharset
        {
            get { return _getSiteCharset; }
            set { _getSiteCharset = value; }
        }

        ///<summary>
        ///站点地址
        ///</summary>
        public RulePara GetSiteUrl
        {
            get { return _getSiteUrl; }
            set { _getSiteUrl = value; }
        }

        ///<summary>
        ///站点搜索地址
        ///</summary>
        public RulePara NovelSearchUrl
        {
            get { return _novelSearchUrl; }
            set { _novelSearchUrl = value; }
        }

        ///<summary>
        ///搜索提交内容
        ///{SearchKey} 表示搜索提交的内容
        ///</summary>
        public RulePara NovelSearchData
        {
            get { return _novelSearchData; }
            set { _novelSearchData = value; }
        }

        ///<summary>
        ///从搜索结果中获得小说编号
        ///{SearchKey} 表示搜索提交的内容
        ///此获得结果存入{NovelKey}变量
        ///</summary>
        public RulePara NovelSearch_GetNovelKey
        {
            get { return _novelSearch_GetNovelKey; }
            set { _novelSearch_GetNovelKey = value; }
        }

        ///<summary>
        ///站点最新列表地址
        ///</summary>
        public RulePara NovelListUrl
        {
            get { return _novelListUrl; }
            set { _novelListUrl = value; }
        }

        ///<summary>
        ///从最新列表中获得小说编号
        ///此规则中可以同时获得书名以方便手动时查看
        ///此获得结果存入{NovelKey}变量
        ///</summary>
        public RulePara NovelList_GetNovelKey
        {
            get { return _novelList_GetNovelKey; }
            set { _novelList_GetNovelKey = value; }
        }

        ///<summary>
        ///小说信息页地址 可调用{NovelKey}变量
        ///{NovelKey}一般情况表示小说编号
        ///</summary>
        public RulePara NovelUrl
        {
            get { return _novelUrl; }
            set { _novelUrl = value; }
        }

        ///<summary>
        ///小说信息页错误识别标记
        ///</summary>
        public RulePara NovelErr
        {
            get { return _novelErr; }
            set { _novelErr = value; }
        }

        ///<summary>
        ///获得小说名称正则
        ///支持多模板
        ///</summary>
        public RulePara NovelName
        {
            get { return _novelName; }
            set { _novelName = value; }
        }

        ///<summary>
        ///获得小说大类正则
        ///支持多模板
        ///</summary>
        public RulePara LagerSort
        {
            get { return _lagerSort; }
            set { _lagerSort = value; }
        }

        ///<summary>
        ///获得小说小类正则
        ///支持多模板
        ///如果目标站点没有小类，这里就重复输入一次大类规则
        ///</summary>
        public RulePara SmallSort
        {
            get { return _smallSort; }
            set { _smallSort = value; }
        }

        ///<summary>
        ///获得小说简介正则
        ///支持多模板
        ///</summary>
        public RulePara NovelIntro
        {
            get { return _novelIntro; }
            set { _novelIntro = value; }
        }

        ///<summary>
        ///获得小说主角(关键字)正则
        ///支持多模板
        ///</summary>
        public RulePara NovelKeyword
        {
            get { return _novelKeyword; }
            set { _novelKeyword = value; }
        }

        ///<summary>
        ///获得写作进程正则
        ///支持多模板
        ///</summary>
        public RulePara NovelDegree
        {
            get { return _novelDegree; }
            set { _novelDegree = value; }
        }

        ///<summary>
        ///获得小说封面正则
        ///支持多模板
        ///</summary>
        public RulePara NovelCover
        {
            get { return _novelCover; }
            set { _novelCover = value; }
        }

        ///<summary>
        ///目标站默认封面地址
        ///遇到这个地址就不采集它的封面
        ///</summary>
        public RulePara NovelDefaultCoverUrl
        {
            get { return _novelDefaultCoverUrl; }
            set { _novelDefaultCoverUrl = value; }
        }

        ///<summary>
        ///获得小说公众目录页地址正则
        ///支持多模板
        ///</summary>
        public RulePara NovelInfo_GetNovelPubKey
        {
            get { return _novelInfo_GetNovelPubKey; }
            set { _novelInfo_GetNovelPubKey = value; }
        }

        ///<summary>
        ///访问公众版需要登陆的Cookies
        ///一般无关，小说阅读网需要这个
        ///</summary>
        public RulePara PubCookies
        {
            get { return _pubCookies; }
            set { _pubCookies = value; }
        }

        ///<summary>
        ///公众目录页地址 可调用{NovelPubKey} {NovelKey}变量
        ///</summary>
        public RulePara PubIndexUrl
        {
            get { return _pubIndexUrl; }
            set { _pubIndexUrl = value; }
        }

        ///<summary>
        ///公众目录页错误识别标记
        ///</summary>
        public RulePara PubIndexErr
        {
            get { return _pubIndexErr; }
            set { _pubIndexErr = value; }
        }

        ///<summary>
        ///获得目录部分关键HTML，一般可留空
        ///</summary>
        public RulePara PubVolumeContent
        {
            get { return _pubVolumeContent; }
            set { _pubVolumeContent = value; }
        }

        ///<summary>
        ///分割分卷
        ///</summary>
        public RulePara PubVolumeSplit
        {
            get { return _pubVolumeSplit; }
            set { _pubVolumeSplit = value; }
        }

        ///<summary>
        ///获得分卷名
        ///支持多模板
        ///</summary>
        public RulePara PubVolumeName
        {
            get { return _pubVolumeName; }
            set { _pubVolumeName = value; }
        }

        ///<summary>
        ///获得章节名
        ///</summary>
        public RulePara PubChapterName
        {
            get { return _pubChapterName; }
            set { _pubChapterName = value; }
        }

        ///<summary>
        ///
        ///</summary>
        public RulePara NovelAuthor
        {
            get { return _novelAuthor; }
            set { _novelAuthor = value; }
        }

        ///<summary>
        ///获得章节地址(章节编号)，所获得的数量必须和章节名相同。记录变量{ChapterKey}
        ///</summary>
        public RulePara PubChapter_GetChapterKey
        {
            get { return _pubChapter_GetChapterKey; }
            set { _pubChapter_GetChapterKey = value; }
        }

        ///<summary>
        ///章节内容页地址 可调用{ChapterKey} {NovelKey}变量
        ///</summary>
        public RulePara PubContentUrl
        {
            get { return _pubContentUrl; }
            set { _pubContentUrl = value; }
        }

        ///<summary>
        ///章节内容页错误识别标记
        ///</summary>
        public RulePara PubContentErr
        {
            get { return _pubContentErr; }
            set { _pubContentErr = value; }
        }

        ///<summary>
        ///内容页中真实内容有JS调用的，获得JS地址 记录变量{TextKey}
        ///</summary>
        public RulePara PubContent_GetTextKey
        {
            get { return _pubContent_GetTextKey; }
            set { _pubContent_GetTextKey = value; }
        }

        ///<summary>
        ///组合真实内容地址
        ///</summary>
        public RulePara PubTextUrl
        {
            get { return _pubTextUrl; }
            set { _pubTextUrl = value; }
        }

        ///<summary>
        ///获得章节内容的正则
        ///支持多模板
        ///(替换在获取图片前)
        ///</summary>
        public RulePara PubContentText
        {
            get { return _pubContentText; }
            set { _pubContentText = value; }
        }

        ///<summary>
        ///每行一个替换，格式如下
        ///需要替换的内容♂替换结果
        ///<div.+?>  这个表示过滤
        ///<div.+?>♂<br>  这个表
        ///</summary>
        public RulePara PubContentReplace
        {
            get { return _pubContentReplace; }
            set { _pubContentReplace = value; }
        }

        ///<summary>
        ///章节内容中提取图片正则
        ///</summary>
        public RulePara PubContentImages
        {
            get { return _pubContentImages; }
            set { _pubContentImages = value; }
        }

        /// <summary>
        /// 全本标记
        /// </summary>
        public RulePara NovelFullText
        {
            get { return _novelFullText; }
            set { _novelFullText = value; }
        }

        #endregion
    }
}
